
# 九九乘法表(for in)其一
for i in range(1, 10):
    for j in range(1, i + 1):
        print('{}*{}={:<3}'.format(i, j, i * j), end=' ')
    print('')

# 九九乘法表(for in)其二
for i in range(9, 0, -1):
    for j in range(1, i + 1):
        print('{}*{}={:<3}'.format(i, j, i * j), end=' ')
    print('')

# 九九乘法表(for in)其三
for i in range(1, 10):
    s = ''
    for j in range(1, i + 1):
        n = '{}*{}={:<3}'.format(i, j, i * j)
        s = n + ' ' + s
    print('{:>72s}'.format(s))

# 九九乘法表(for in)其四
for i in range(9, 0, -1):
    s = ''
    for j in range(1, i + 1):
        n = '{}*{}={:<3}'.format(i, j, i * j)
        s = n + ' ' + s
    print('{:>72s}'.format(s))

# 九九乘法表(while)其一
i = 1
while i < 10:
    j = 1
    while j <= i:
        print('{}*{}={:<3}'.format(i, j, i * j), end=' ')
        j += 1
    print('')
    i += 1

# 九九乘法表(while)其二
i = 9
while i > 0:
    j = 1
    while j <= i:
        print('{}*{}={:<3}'.format(i, j, i * j), end=' ')
        j += 1
    print('')
    i -= 1

# 九九乘法表(while)其三
i = 1
while i < 10:
    j = 1
    s = ''
    while j <= i:
        n = '{}*{}={:<3}'.format(i, j, i * j)
        s = n+''+s
        j += 1
    print('{:>64s}'.format(s))
    i += 1

# 九九乘法表(while)其四
i = 9
while i > 0:
    j = 1
    s = ''
    while j <= i:
        n = '{}*{}={:<3}'.format(i, j, i * j)
        s = n+''+s
        j += 1
    print('{:>64s}'.format(s))
    i -= 1
